package com.minelx.scriptbuilder.script.operation;

import com.minelx.scriptbuilder.script.attribute.clazz.Class;
import com.minelx.scriptbuilder.script.attribute.value.IAttribute;

public class ClassDeclareOperation implements IOperation {

	private final IAttribute declareOn;

	private final String className;

	private final Class aClass;

	private final IOperation functionDeclarations;

	public ClassDeclareOperation(IAttribute declareOn, String className, Class aClass, IOperation functionDeclarations) {
		this.declareOn = declareOn;
		this.className = className;
		this.aClass = aClass;
		this.functionDeclarations = functionDeclarations;
	}

	@Override
	public void execute() {
		functionDeclarations.execute();
		declareOn.set(className, aClass);
	}
}
